package com.hrprojectback.service.impl.XinXiGuanLiServiceImpl;

import com.hrprojectback.dto.Role;
import com.hrprojectback.mapper.RoleMapper;
import com.hrprojectback.service.XinXiGuanLiService.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public Integer getRoleCounts(String roleSign, String name) {
        Integer UserCounts = roleMapper.getRoleCounts(roleSign, name);
        return UserCounts;
    }

    @Override
    public List<Role> getRole(String sign, String name, int pageStart, int pageSize) {
        List<Role> roles = roleMapper.getRole(sign, name, pageStart, pageSize);
        return roles;
    }

    @Override
    public int addRole(Role role) {
        int i = roleMapper.addRole(role);
        return i;
    }

    @Override
    public Role getEditRole(String roleSign) {
        Role editRole = roleMapper.geteditRole(roleSign);
        return editRole;
    }

    @Override
    public int editRole(Role role) {
        int i = roleMapper.editRole(role);
        return i;
    }

    @Override
    public int deleteRole(String username) {
        int i = roleMapper.deleteRole(username);
        return i;
    }

    @Override
    public int ShengXiao(String username) {
        int i = roleMapper.ShengXiao(username);
        return i;
    }

    @Override
    public int YiShiXiAo(String username) {
        int i = roleMapper.YiShiXiAo(username);
        return i;
    }

    @Override
    public int getStatus(String username) {
        int status = roleMapper.getStatus(username);
        return status;
    }
}
